package top.btcmarket.auth.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import top.btcmarket.auth.entity.User;
import top.btcmarket.auth.mapper.UserRepository;
import top.btcmarket.auth.service.UserService;


@Service
public class UserServiceImpl implements UserService {

    @Autowired
    private UserRepository userRepository;

    @Override
    public User findByUsername(String name) {
        return userRepository.findByUsername(name);
    }

    @Override
    public List<User> findAll() {
        return userRepository.findAll();
    }

	@Override
	public User findById(int id) {
		// TODO Auto-generated method stub
		 return userRepository.findById(id);
	}

	@Override
	public User findByUsernameAndPassword(String name, String password) {
		// TODO Auto-generated method stub
		return userRepository.findByUsernameAndPassword(name, password);
	}

}
